namespace Lucene.Linq.Storage
{
    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IEntitySerializer<T>
        where T : IEntity, new()
    {
        /// <summary>
        /// Deserialize the object from array of bytes into actual object
        /// </summary>
        /// <param name="data">data to deserialize</param>
        /// <returns>Data as actual object using BinaryFormatter</returns>
        T Deserialize(byte[] data);

        /// <summary>
        /// Serialize the object into array of bytes
        /// </summary>
        /// <param name="data">Data to serialize</param>
        /// <returns>Data as array of bytes using BinaryFormatter</returns>
        byte[] Serialize(T data);
    }
}